get basename without extension python

29

from pathlib import Path

Path('/root/dir/sub/file.ext').stem
# returns file

Comments

Submit
0 Comments